﻿import request from '/@/utils/request';
enum Api {
  AddXuanKe = '/api/xuanKe/add',
  DeleteXuanKe = '/api/xuanKe/delete',
  UpdateXuanKe = '/api/xuanKe/update',

  PageXuanKe = '/api/xuanKe/page',
  DetailXuanKe = '/api/xuanKe/detail',
  ExportXuanke = '/api/xuanKe/export',
  GetXuankeTaskXuankeTaskIdDropdown = '/api/xuanKe/XuankeTaskXuankeTaskIdDropdown',
  GetBanjiBanjiIdDropdown = '/api/xuanKe/BanjiBanjiIdDropdown',
  GetJiaoxueBanJiaoxueBanIdDropdown = '/api/xuanKe/JiaoxueBanJiaoxueBanIdDropdown',
  GetStudentStudentIdDropdown = '/api/xuanKe/StudentStudentIdDropdown',
  GetKechengKechengIdDropdown = '/api/xuanKe/KechengKechengIdDropdown',
}

// 增加校本选课
export const addXuanKe = (params?: any) =>
	request({
		url: Api.AddXuanKe,
		method: 'post',
		data: params,
	});

// 删除校本选课
export const deleteXuanKe = (params?: any) => 
	request({
			url: Api.DeleteXuanKe,
			method: 'post',
			data: params,
		});

// 编辑校本选课
export const updateXuanKe = (params?: any) => 
	request({
			url: Api.UpdateXuanKe,
			method: 'post',
			data: params,
		});

		
// 分页查询校本选课
export const pageXuanKe = (params?: any) => 
	request({
			url: Api.PageXuanKe,
			method: 'post',
			data: params,
		});

// 详情校本选课
export const detailXuanKe = (id: any) => 
	request({
			url: Api.DetailXuanKe,
			method: 'get',
			data: { id },
		});

export const exportXuanke = (params?: any) => 
	request({
			url: Api.ExportXuanke,
			method: 'post',
			data: params,
			responseType: "blob"
		});

export const getXuankeTaskXuankeTaskIdDropdown = () =>
		request({
		url: Api.GetXuankeTaskXuankeTaskIdDropdown,
		method: 'get'
		});
export const getBanjiBanjiIdDropdown = () =>
		request({
		url: Api.GetBanjiBanjiIdDropdown,
		method: 'get'
		});
export const getJiaoxueBanJiaoxueBanIdDropdown = () =>
		request({
		url: Api.GetJiaoxueBanJiaoxueBanIdDropdown,
		method: 'get'
		});
export const getStudentStudentIdDropdown = () =>
		request({
		url: Api.GetStudentStudentIdDropdown,
		method: 'get'
		});
export const getKechengKechengIdDropdown = (xuankeTaskId: any) =>
		request({
		url: Api.GetKechengKechengIdDropdown + '/' + xuankeTaskId,
		method: 'get'
		});

